package com.yonyou.pmclouds.team.entity;

import com.yonyou.pmclouds.basecom.entity.SuperVO;
import lombok.Data;

import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Transient;
import java.util.Date;

@Data
@Table(name = "pmbd_team_member")
public class TeamMemberVO extends SuperVO {
    public static final String PK_TEAM_MEMBER = "pkTeamMember";
    public static final String PK_PROJECT = "pkProject";
    public static final String PK_USER = "pkUser";
    public static final String PROJECT_STATE = "projectState";
    public static final String USER_NAME = "userName";
    public static final String USER_ROLE = "userRole";
    public static final String ENTERPRISE_NAME = "enterpriseName";
    public static final String PK_ENTERPRISE = "pkEnterprise";
    public static final String EMAIL = "email";
    public static final String PHONE_NO = "phoneNo";

    @Id
    private String pkTeamMember;
    /**
     * 团队成员
     */
    private String pkUser;
    /**
     * 项目
     */
    private String pkProject;
    private String pkTenant;
    /**
     * 用户所属企业re
     */
    private String pkEnterprise;
    @Transient
    private String enterpriseName;

    private Byte userRole;
    /**
     * 项目状态，这个是冗余数据
     */
    private byte projectState;
    private String creator;
    private Date creationtime;
    private String modifier;
    private Date modifytime;

    @Transient
    private String phoneNo;
    @Transient
    private String email;
    @Transient
    private String userName;

    /**
     * 成员角色常量
     */
    public interface UserRoleConst {

        // 项目经理单独角色后续弃用，切勿采用
        byte ROLE_MANAGER = 0;

        /**
         * 业主方、甲方
         */
        byte ROLE_OWNER = TeamEnterpriseVO.EnterpriseRoleConst.ROLE_OWNER;
        /**
         * 施工方、乙方
         */
        byte ROLE_CONSTRUCTOR = TeamEnterpriseVO.EnterpriseRoleConst.ROLE_CONSTRUCTOR;
        /**
         * 监理方
         */
        byte ROLE_SUPERVISOR = TeamEnterpriseVO.EnterpriseRoleConst.ROLE_SUPERVISOR;
    }
}
